package main

import (
	"flag"
	"os"
	"tinyc/code/tinyc/container"
)

func childRun() {
	var imageDir string
	fs := flag.NewFlagSet("_run", flag.ExitOnError)
	fs.StringVar(&imageDir, "i", "", "image dir")
	assert(fs.Parse(os.Args[2:]))

	c := container.New(fs.Arg(0), fs.Args()[1:]...)
	assert(c.PivotRoot(imageDir))
	assert(c.Init())
	defer c.Close()
	assert(c.Run())
}
